package com.example.daggerdemo01.module;


import android.content.Context;

import com.example.daggerdemo01.database.DBHelper;

import dagger.Module;
import dagger.Provides;
import jakarta.inject.Singleton;

@Module
public class DBModule {
    private Context mContext;
    @Singleton
    public DBModule(Context context){
        mContext = context;
    }
    @Singleton
    @Provides
    public Context contextProvider() {
        return mContext;
    }

    @Provides
    public DBHelper dbHelperProvider() {
        return new DBHelper(mContext);
    }
}